package com.wchc.controller;


import com.wchc.order.Order;
import com.wchc.order.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("order")
public class OrderController {


    @Resource
    private OrderService orderService;

    @GetMapping("create")
    public Order createOrder(String productId){
       return orderService.createOrder(productId);
    }

    @GetMapping("pay")
    public Order payOrder(String orderId){
        return orderService.payOrder(orderId);
    }


    @GetMapping("send")
    public Order sendOrder(String orderId){
        return orderService.sendOrder(orderId);
    }

    @GetMapping("receive")
    public Order receiveOrder(String orderId){
        return orderService.receiveOrder(orderId);
    }
}
